#!/usr/bin/env python
import numpy as np
import scipy as sp
from scipy import linalg as la

A = np.mat('[1 3 5; 2 5 1; 2 3 8]')

#[1 3 5]
#[2 5 1]
#[2 3 8] 

print ('A: \n')
print (A)

print ('A^-1 \n')
print (A.I)

print ('Det \n') 
print (la.det( A))

print ('\nSVD') 
print (la.svd( A))

print ('\nFrob') 
print (la.norm(A, 'f'))

print ('\ninf') 
print (la.norm(A, float('inf')))

print ('\n-inf') 
print (la.norm(A, float('-inf')))

print ('\n1 norm') 
print (la.norm(A, 1))

print ('\n-1 norm') 
print (la.norm(A, -1))

print ('\n2 norm ') 
print (la.norm(A, 2))

print ('\n-2 norm') 
print (la.norm(A, -2))

print ('\n Matrix power ')
print ( np.linalg.matrix_power(A, 2))

print ('\n Element wise exponentiation')
print (np.power(A, 2))


print (A * B)